<template>
	<el-drawer title="考试详情" v-model="visible" :size="800" destroy-on-close @closed="$emit('closed')">
		<el-container v-loading="loading">
			<el-main>
				<el-form :model="form"  ref="dialogForm" label-width="100px" label-position="left">
					<el-form-item label="考试标题" prop="title">{{form.title}}
					</el-form-item>
					<el-row :gutter="24">
						<el-col :lg="12">
							<el-form-item label="主考部门" prop="deptId">{{form.deptName}}
							</el-form-item>
						</el-col>
						<el-col :lg="12">
							<el-form-item label="选择试卷" prop="questionRecordId">{{(JSON.parse(form.questionRecordId)).title}}
							</el-form-item>
						</el-col>
					</el-row>
					<el-row :gutter="24">
						<el-col :lg="12">
							<el-form-item label="开始时间" prop="beginTime">{{form.beginTime}}
							</el-form-item>
						</el-col>
						<el-col :lg="12">
							<el-form-item label="结束时间" prop="endTime">{{form.endTime}}
							</el-form-item>
						</el-col>
					</el-row>
					<el-row :gutter="24">
						<el-col :lg="12">
							<el-form-item label="考试时长" prop="duration">{{form.duration}}/分钟
							</el-form-item>
						</el-col>
						<el-col :lg="12">
							<el-form-item label="合格分数" prop="passMark">{{form.passMark}}/分
							</el-form-item>
						</el-col>
					</el-row>
					<el-row :gutter="24">
						<el-col :lg="12">
							<el-form-item label="是否开否" prop="isOpen">
								<el-tag type="success" effect="dark" v-if="form.isOpen==='1'">开卷</el-tag>
								<el-tag type="danger" effect="dark" v-else>闭卷</el-tag>
							</el-form-item>
						</el-col>
					</el-row>
					<el-form-item label="备注说明">{{form.remark}}
					</el-form-item>
					<el-form-item label="参考资料" v-if="form.attachId!=''">
						<attach-menu :attachIds="form.attachId" :roleFlag="3" :preview="true"></attach-menu>
					</el-form-item>
				</el-form>
				<el-footer style="text-align: center;">
					<el-button @click="visible=false">关闭</el-button>
				</el-footer>
			</el-main>
		</el-container>
	</el-drawer>
</template>

<script>
import AttachMenu from '@/views/module/attachMenu'
export default {
	emits: ['success', 'closed'],
	components: {
		AttachMenu
	},
	data() {
		return {
			loading: false,
			questionsList:[],
			form: {
			},
			visible: false,
			isSaveing: false,
		}
	},
	mounted() {

	},
	methods: {
		//显示
		open(model) {
			this.model = model;
			this.visible = true;
			return this;
		},
		//表单注入数据
		setData(data) {
			this.form = data;
		},
	}
}
</script>

<style>
</style>
